﻿<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configuration_type_map>
  </configuration_type_map>

  <logging>
    <configuration_type_map>
      <log_category assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogCategories.DefaultLogCategory"/>
      <default_log_formatter assembly="SharpObjects.Logging" type="SharpObjects.Logging.Formatters.DefaultLogFormatter"/>
      <xml_log_formatter assembly="SharpObjects.Logging" type="SharpObjects.Logging.Formatters.XmlLogFormatter"/>
      <single_line_log_formatter assembly="SharpObjects.Logging" type="SharpObjects.Logging.Formatters.SingleLineLogFormatter"/>
      <fast_text_log_target assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogTargets.TextFileLogTarget"/>
      <safe_text_log_target assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogTargets.SafeTextFileLogTarget"/>
      <xml_log_target assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogTargets.TextFileLogTarget"/>
      <event_log_target assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogTargets.EventLogTarget"/>
      <console_log_target assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogTargets.ConsoleLogTarget"/>
      <binary_log_target assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogTargets.BinaryFileLogTarget"/>
      <target_proxy assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogTargets.LogTargetProxy"/>
      <msmq_log_target assembly="SharpObjects.Logging" type="SharpObjects.Logging.LogTargets.PrivateMsmqLogTarget"/>
      <origin_filter assembly="SharpObjects.Logging" type="SharpObjects.Logging.OriginFilter"/>
    </configuration_type_map>

    <log_categories>

      <log_category id="DEBUG" index="0" is_enabled="true">
        <targets>
          <target_proxy is_enabled="true" xpath="//logging/targets/fast_text_log_target" />
          <target_proxy is_enabled="true" xpath="//logging/targets/console_target" />
        </targets>
      </log_category>

      <log_category id="INFO" index="1" is_enabled="true">
        <targets>
          <target_proxy is_enabled="true" xpath="//logging/targets/fast_text_log_target" />
          <target_proxy is_enabled="true" xpath="//logging/targets/xml_log_target" />
          <target_proxy is_enabled="true" xpath="//logging/targets/console_target" />
        </targets>
      </log_category>

      <log_category id="WARNING" index="2" is_enabled="true">
        <targets>
          <target_proxy is_enabled="true" xpath="//logging/targets/fast_text_log_target" />
          <target_proxy is_enabled="true" xpath="//logging/targets/console_target" />
        </targets>
      </log_category>

      <log_category id="ERROR" index="3" is_enabled="true">
        <targets>
          <target_proxy is_enabled="true" xpath="//logging/targets/safe_text_log_target" />
          <target_proxy is_enabled="true" xpath="//logging/targets/console_target">
            <origin_filter>
              <include>
                <starts_with>aaa</starts_with>
                <starts_with>bbb</starts_with>
                <contains>ccc</contains>
                <contains>ddd</contains>
                <ends_with>eee</ends_with>
                <ends_with>fff</ends_with>
              </include>
              <exclude>
                <starts_with>ggg</starts_with>
                <starts_with>hhh</starts_with>
                <contains>iii</contains>
                <contains>jjj</contains>
                <ends_with>kkk</ends_with>
                <ends_with>lll</ends_with>
              </exclude>
            </origin_filter>
          </target_proxy>
        </targets>
      </log_category>

      <log_category id="TEST" index="0" is_enabled="true">
        <targets>
          <target_proxy is_enabled="true" xpath="//logging/targets/console_target" />
        </targets>
        <origin_filter>
          <include>
            <starts_with>aaa</starts_with>
            <starts_with>bbb</starts_with>
            <contains>ccc</contains>
            <contains>ddd</contains>
            <ends_with>eee</ends_with>
            <ends_with>fff</ends_with>
          </include>
          <exclude>
            <starts_with>ggg</starts_with>
            <starts_with>hhh</starts_with>
            <contains>iii</contains>
            <contains>jjj</contains>
            <ends_with>kkk</ends_with>
            <ends_with>lll</ends_with>
          </exclude>
        </origin_filter>
      </log_category>
    </log_categories>
    
    <log_targets>
      
      <fast_text_log_target is_enabled="true">
        <!--<formatter_id>default_log_formatter</formatter_id>-->
        <formatter pathref="//logging/formatters/default_log_formatter" />
        <directory map_to_app_data="false">Logs</directory>
        <file_name_base>SharpObjects.Logging_Test_FastText</file_name_base>
        <file_extension>log</file_extension>
        <log_max_size units="mb">2</log_max_size>
        <keep_history_for units="day">30</keep_history_for>
      </fast_text_log_target>

      <safe_text_log_target is_enabled="true">
        <formatter pathref="//logging/formatters/default_log_formatter" />
        <directory>Logs</directory>
        <file_name_base>SharpObjects.Logging_Test_SafeText</file_name_base>
        <file_extension>log</file_extension>
        <log_max_size units="kb">2048</log_max_size>
        <keep_history_for>30</keep_history_for>
        <origin_filter>
          <include>
            <starts_with>aaa</starts_with>
            <starts_with>bbb</starts_with>
            <contains>ccc</contains>
            <contains>ddd</contains>
            <ends_with>eee</ends_with>
            <ends_with>fff</ends_with>
          </include>
          <exclude>
            <starts_with>ggg</starts_with>
            <starts_with>hhh</starts_with>
            <contains>iii</contains>
            <contains>jjj</contains>
            <ends_with>kkk</ends_with>
            <ends_with>lll</ends_with>
          </exclude>
        </origin_filter>
      </safe_text_log_target>

      <xml_log_target is_enabled="true">
        <formatter pathref="//logging/formatters/xml_log_formatter" />
        <directory>Logs</directory>
        <file_name_base>SharpObjects.Logging_Test_Xml</file_name_base>
        <file_extension>log</file_extension>
        <log_max_size units="b">2097152</log_max_size>
        <keep_history_for units="month">18</keep_history_for>
      </xml_log_target>

      <event_log_target is_enabled="true">
        <formatter pathref="//formatters/default_log_formatter"/>
        <source_name>SharpObjects_Logging_Test</source_name>
        <log_name>SharpObjects_Logging_TestLog</log_name>
        <target_machine_name>localhost</target_machine_name>
        <log_max_size units="kb">2000</log_max_size>
        <backup_and_cleanup>true</backup_and_cleanup>
        <max_entries_before_backup>2000</max_entries_before_backup>
        <overwrite_as_needed>true</overwrite_as_needed>
      </event_log_target>
      
      <binary_log_target is_enabled="true">
        <directory>Logs</directory>
        <file_name_base>SharpObjects.Logging_Test_Binary</file_name_base>
        <file_extension>blog</file_extension>
        <log_max_size>2097152</log_max_size>
        <keep_history_for units="hour">2</keep_history_for>
      </binary_log_target>

      <console_log_target is_enabled="true">
        <formatter pathref="//logging/formatters/default_log_formatter" />
      </console_log_target>

      <msmq_log_target is_enabled="true">
        <queue_name_base>SharpObjects.Logging_TestMsmqLog</queue_name_base>
        <recoverable_messages>false</recoverable_messages>
      </msmq_log_target>

    </log_targets>


    <log_formatters>

      <default_log_formatter>
        <message_separator>___________________________________________</message_separator>
        <time_format>yyyy-MM-dd HH:mm:ss</time_format>
      </default_log_formatter>

      <xml_log_formatter>
        <time_format>yyyy-MM-dd HH:mm:ss</time_format>
      </xml_log_formatter>

      <single_line_log_formatter/>

    </log_formatters>
  
  
  </logging>
  
</configuration>
